<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>图书列表</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
</head>

<body>
<a class="btn btn-sm btn-success" th:href="@{/book/add}" th:text="添加图书">添加图书</a>
<div>
    <table class="table">
        <thead>
        <tr>
            <th>编号</th>
            <th>书名</th>
            <th>图书数量</th>
            <th>介绍</th>
            <th>相关操作</th>
        </tr>
        </thead>
        <tbody>
        <div th:each="book : ${books}">
            <tr>
                <th th:text="${book.id}">1</th>
                <td th:text="${book.name}">十万个为什么</td>
                <td th:text="${book.count}">2</td>
                <td th:text="${book.detail}">科普相关的书</td>
                <td>
                    <a class="btn btn-primary" th:href="@{/book/{id}/delete(id=${book.id})}" href="#" role="button">删除</a>
                    <a class="btn btn-primary" th:href="@{/book/{id}/update(id=${book.id})}" href="#" role="button">编辑</a>
                    <a class="btn btn-primary" th:href="@{/book/{id}/info(id=${book.id})}" href="#" role="button">查看</a>
                </td>
            </tr>
        </div>
        </tbody>
    </table>
</div>
</body>

</html>